// 封装频道相关的本地存储的逻辑
import { Channel } from '@/types/data'
const CHANNELS_KEY = 'geeks-channels'

// 获取
export function getChannels(): Channel[] {
  return JSON.parse(localStorage.getItem(CHANNELS_KEY) || '{}')
}

// 设置
export function setChannels(channels: Channel[]) {
  localStorage.setItem(CHANNELS_KEY, JSON.stringify(channels))
}

// 移除
export function removeChannels() {
  localStorage.removeItem(CHANNELS_KEY)
}
